#include <iostream>
#include <stdio.h>
#include <cmath>

using namespace std;

long long is_zs(int a){
    if(a == 2){
        return 2;
    }
    else if(a % 2 == 0){
        return -1;
    }
    for(int i = 3; i <= (long long)sqrt(a)+1; i += 2){
        if(a % i == 0){
            return -1;
        }
    }
    return a;
}

int main() {
    int n,n2=0,j=2;
    long long n3;
    cin >> n;
    while(n2 < n){
        if(is_zs(j) != -1){
            n2 += 1;
            n3 = j;
        }
        j+=1;
    }
    cout << n3;
    return 0;
}